From f76880f2050c622e5a34c7419ecd6d2c9379c713 Mon Sep 17 00:00:00 2001 From: Lars Hamann Date: Fri, 4 Dec 1998 00:04:31 +0000 Subject: [PATCH] fixed for-loop. Fri Dec 4 00:50:12 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. * gtk/gtkclist.c (gtk_clist_set_column_visibility) (gtk_clist_column_titles_active) (gtk_clist_column_titles_active) (gtk_clist_column_title_passive) (gtk_clist_column_title_active): few additional tests whether column->button != NULL --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-0 | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-2 | 12 ++++++++++++ ChangeLog.pre-2-4 | 12 ++++++++++++ ChangeLog.pre-2-6 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gtk/gtkclist.c | 29 +++++++++++++++++++---------- gtk/gtkctree.c | 17 +++++++++-------- 9 files changed, 112 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ced4127ad..c705531845 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Fri Dec 4 00:50:12 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. + + * gtk/gtkclist.c + (gtk_clist_set_column_visibility) + (gtk_clist_column_titles_active) + (gtk_clist_column_titles_active) + (gtk_clist_column_title_passive) + (gtk_clist_column_title_active): few additional tests whether + column->button != NULL + Thu Dec 3 16:49:18 1998 Owen Taylor * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8ced4127ad..c705531845 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,15 @@ +Fri Dec 4 00:50:12 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. + + * gtk/gtkclist.c + (gtk_clist_set_column_visibility) + (gtk_clist_column_titles_active) + (gtk_clist_column_titles_active) + (gtk_clist_column_title_passive) + (gtk_clist_column_title_active): few additional tests whether + column->button != NULL + Thu Dec 3 16:49:18 1998 Owen Taylor * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8ced4127ad..c705531845 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +Fri Dec 4 00:50:12 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. + + * gtk/gtkclist.c + (gtk_clist_set_column_visibility) + (gtk_clist_column_titles_active) + (gtk_clist_column_titles_active) + (gtk_clist_column_title_passive) + (gtk_clist_column_title_active): few additional tests whether + column->button != NULL + Thu Dec 3 16:49:18 1998 Owen Taylor * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8ced4127ad..c705531845 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,15 @@ +Fri Dec 4 00:50:12 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. + + * gtk/gtkclist.c + (gtk_clist_set_column_visibility) + (gtk_clist_column_titles_active) + (gtk_clist_column_titles_active) + (gtk_clist_column_title_passive) + (gtk_clist_column_title_active): few additional tests whether + column->button != NULL + Thu Dec 3 16:49:18 1998 Owen Taylor * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8ced4127ad..c705531845 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +Fri Dec 4 00:50:12 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. + + * gtk/gtkclist.c + (gtk_clist_set_column_visibility) + (gtk_clist_column_titles_active) + (gtk_clist_column_titles_active) + (gtk_clist_column_title_passive) + (gtk_clist_column_title_active): few additional tests whether + column->button != NULL + Thu Dec 3 16:49:18 1998 Owen Taylor * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8ced4127ad..c705531845 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +Fri Dec 4 00:50:12 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. + + * gtk/gtkclist.c + (gtk_clist_set_column_visibility) + (gtk_clist_column_titles_active) + (gtk_clist_column_titles_active) + (gtk_clist_column_title_passive) + (gtk_clist_column_title_active): few additional tests whether + column->button != NULL + Thu Dec 3 16:49:18 1998 Owen Taylor * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8ced4127ad..c705531845 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +Fri Dec 4 00:50:12 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop. + + * gtk/gtkclist.c + (gtk_clist_set_column_visibility) + (gtk_clist_column_titles_active) + (gtk_clist_column_titles_active) + (gtk_clist_column_title_passive) + (gtk_clist_column_title_active): few additional tests whether + column->button != NULL + Thu Dec 3 16:49:18 1998 Owen Taylor * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index 08dabda04d..d49d4d3c5e 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -1255,7 +1255,7 @@ gtk_clist_column_titles_show (GtkCList *clist) { GTK_CLIST_SET_FLAG (clist, CLIST_SHOW_TITLES); if (clist->title_window) - gdk_window_show (clist->title_window); + gdk_window_show (clist->title_window); gtk_widget_queue_resize (GTK_WIDGET (clist)); } } @@ -1270,7 +1270,7 @@ gtk_clist_column_titles_hide (GtkCList *clist) { GTK_CLIST_UNSET_FLAG (clist, CLIST_SHOW_TITLES); if (clist->title_window) - gdk_window_hide (clist->title_window); + gdk_window_hide (clist->title_window); gtk_widget_queue_resize (GTK_WIDGET (clist)); } } @@ -1284,6 +1284,8 @@ gtk_clist_column_title_active (GtkCList *clist, if (column < 0 || column >= clist->columns) return; + if (!clist->column[column].button) + return; if (!GTK_WIDGET_SENSITIVE (clist->column[column].button) || !GTK_WIDGET_CAN_FOCUS (clist->column[column].button)) @@ -1304,6 +1306,8 @@ gtk_clist_column_title_passive (GtkCList *clist, if (column < 0 || column >= clist->columns) return; + if (!clist->column[column].button) + return; if (GTK_WIDGET_SENSITIVE (clist->column[column].button) || GTK_WIDGET_CAN_FOCUS (clist->column[column].button)) @@ -1324,8 +1328,7 @@ gtk_clist_column_titles_active (GtkCList *clist) g_return_if_fail (GTK_IS_CLIST (clist)); for (i = 0; i < clist->columns; i++) - if (clist->column[i].button) - gtk_clist_column_title_active (clist, i); + gtk_clist_column_title_active (clist, i); } void @@ -1336,9 +1339,11 @@ gtk_clist_column_titles_passive (GtkCList *clist) g_return_if_fail (clist != NULL); g_return_if_fail (GTK_IS_CLIST (clist)); + if (!GTK_CLIST_SHOW_TITLES (clist)) + return; + for (i = 0; i < clist->columns; i++) - if (clist->column[i].button) - gtk_clist_column_title_passive (clist, i); + gtk_clist_column_title_passive (clist, i); } void @@ -1554,10 +1559,14 @@ gtk_clist_set_column_visibility (GtkCList *clist, } clist->column[column].visible = visible; - if (visible) - gtk_widget_show (clist->column[column].button); - else - gtk_widget_hide (clist->column[column].button); + + if (clist->column[column].button) + { + if (visible) + gtk_widget_show (clist->column[column].button); + else + gtk_widget_hide (clist->column[column].button); + } } void diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c index 132e3a44b6..e4940fd32c 100644 --- a/gtk/gtkctree.c +++ b/gtk/gtkctree.c @@ -4157,7 +4157,6 @@ gtk_ctree_export_to_gnode (GtkCTree *ctree, { GtkCTreeNode *work; GNode *gnode; - GNode *new_sibling; gint depth; g_return_val_if_fail (ctree != NULL, NULL); @@ -4182,15 +4181,17 @@ gtk_ctree_export_to_gnode (GtkCTree *ctree, if (parent) g_node_insert_before (parent, sibling, gnode); - for (work = GTK_CTREE_ROW (node)->children, new_sibling = NULL; work; - work = GTK_CTREE_NODE_NEXT (work)) + if (!GTK_CTREE_ROW (node)->is_leaf) { - sibling = gtk_ctree_export_to_gnode (ctree, gnode, new_sibling, - work, func, data); - if (sibling) - new_sibling = sibling; + GNode *new_sibling = NULL; + + for (work = GTK_CTREE_ROW (node)->children; work; + work = GTK_CTREE_ROW (work)->sibling) + new_sibling = gtk_ctree_export_to_gnode (ctree, gnode, new_sibling, + work, func, data); + + g_node_reverse_children (gnode); } - g_node_reverse_children (gnode); return gnode; } -- 2.30.2